package sk.xorty.si;

import org.springframework.stereotype.Component;
import sk.xorty.oxm.Sales;

import java.util.Arrays;

@Component
public class SalesMapper implements Mapper {

    @Override
    public Object map(String[] content) {
        System.out.println("======== MAPPER INVOKED ========");
        System.out.println("\t=> Mapping content to Sales: " + Arrays.toString(content));

        Sales sales = new Sales();
        sales.setId(content[0]);
        sales.setBranch(content[1]);
        sales.setKeyword(content[2]);
        sales.setAmount(Double.valueOf(content[3]));
        sales.setRemarks(content[4]);

        return sales;
    }

}
